<template>
  <!--课题相关信息维护-->
  <div>
    <div class="edu-page-warp">
      <div class="edu-page-title">
        <el-radio-group v-model="showType" class="edu-title-tab" @change="handleRadioChange">
          <el-radio-button label="source">{{$t('graduationDesign.subjectSource')}}</el-radio-button>
          <el-radio-button label="nature">{{$t('graduationDesign.subjectNature')}}</el-radio-button>
          <el-radio-button label="practice">{{$t('graduationDesign.socialPractice')}}</el-radio-button>
        </el-radio-group>
      </div>
    </div>
    <div>
      <SubjectSource v-if="showType === 'source'"></SubjectSource>
      <SubjectNature v-if="showType === 'nature'"></SubjectNature>
      <SocialPractice v-if="showType === 'practice'"></SocialPractice>
    </div>
  </div>
</template>
<script>
export default {
  name: 'subjectInfoMaintain',
  data() {
    return {
      showType: 'source',
      pageInfo: {
        title: '课题来源',
        value: 'source',
        tableName: 'subjectSourceTable'
      }
    };
  },
  created() { },
  methods: {
    handleRadioChange(val) {
      switch (val) {
        case 'source':
          this.pageInfo.title = '课题来源';
          this.pageInfo.value = 'source';
          this.pageInfo.tableName = 'subjectSourceTable';
          break;
        case 'nature':
          this.pageInfo.title = '课题性质';
          this.pageInfo.value = 'nature';
          this.pageInfo.tableName = 'subjectNatureTable';
          break;
        case 'practice':
          this.pageInfo.title = '其中社会实践情况';
          this.pageInfo.value = 'practice';
          this.pageInfo.tableName = 'subjectPracticeTable';
          break;
        default:
          break;
      }
    }
  },
  components: {
    SubjectSource: () => import('./components/subjectSource'),
    SubjectNature: () => import('./components/subjectNature'),
    SocialPractice: () => import('./components/socialPractice')
  }
}
</script>
<style lang="scss" scoped>
</style>
